import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login.vue'
import Register from '@/views/register.vue'
import Layout from '@/views/layout.vue'
import Article from '@/views/article.vue'
import Collect from '@/views/collect.vue'
import Like from '@/views/like.vue'
import User from '@/views/user.vue'
Vue.use(VueRouter)

// /collect = / + collect
// /zhejiang/hangzhou = /zhejiang + hangzhou

const routes = [
  { path: '/login', component: Login },
  { path: '/register', component: Register },
  {
    path: '/',
    component: Layout,
    // 路由重定向 默认打开页面显示面经路由
    redirect: '/article',
    children: [
      { path: 'article', component: Article },
      { path: 'collect', component: Collect },
      { path: 'like', component: Like },
      { path: 'user', component: User }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router

// 主题定制
// 思路一 自己写样式覆盖 好处 省事 缺点 下次在别的页面遇到同样的要改，样式再写一次
// 思路二 直接把这个组件主题改掉
